﻿using System;
using System.Collections.Generic;

namespace Zeus.Biz.Northwind.Model
{
    [Serializable]
    public class Employee : IComparable<Employee>
    {
        public int EmployeeID { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }

        public int Age { get; set; }

        public List<Order> Orders { get; set; }

        public override string ToString()
        {
            string format = "Employee ID: {0}\nLast Name: {1}\nFirst Name: {2}\nAge: {3}";

            return string.Format(format, EmployeeID, LastName, FirstName, Age);
        }

        public int CompareTo(Employee emp)
        {
            if (emp == null)
                return 1;
            
            if (Age < emp.Age)
                return -1;
            else if (Age == emp.Age)
                return 0;
            else
                return 1;
        }
    }
}
